<template>
  <view>
    <view class="uni-container">
      <uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
        @selection-change="selectionChange">
        <uni-tr>
          <uni-th align="center">会员id</uni-th>
          <uni-th align="center">申请订单编号</uni-th>
          <uni-th align="center">状态</uni-th>
          <uni-th align="center">开票总金额</uni-th>
          <uni-th align="center">总服务金额</uni-th>
          <uni-th align="center">总电费金额</uni-th>
          <uni-th width="204" align="center">操作</uni-th>
        </uni-tr>
        <uni-tr v-for="(item, index) in invoiceList" :key="index">
          <uni-td>{{ item.memberId }}</uni-td>
          <uni-td>
            <view class="name">{{ item.orderCodes }}</view>
          </uni-td>
          <uni-td align="center">{{ item.status }}</uni-td>
          <uni-td align="center">{{ item.totalAmount }}</uni-td>
          <uni-td align="center">{{ item.totalServiceAmount }}</uni-td>
          <uni-td align="center">{{ item.totalElecAmount }}</uni-td>

          <uni-td>
            <view class="uni-group">
              <button class="uni-button" size="mini" type="primary">修改</button>
              <button class="uni-button" size="mini" type="warn">删除</button>
            </view>
          </uni-td>
        </uni-tr>
      </uni-table>
      <view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize" :current="pageCurrent"
          :total="total" @change="change" /></view>
    </view>
  </view>
</template>


<script>
  export default {
    name: "orderTable",
    props: ['invoiceList'],
    data() {
      return {
        searchVal: '',
        tableData: [],
        // 每页数据量
        pageSize: 10,
        // 当前页
        pageCurrent: 1,
        // 数据总量
        total: 0,
        loading: false
      };
    },
    methods: {
      selectionChange(e) {
        console.log(e.detail.index)
        // this.selectedIndexs = e.detail.index
      },
      change(e) {
        console.log(e);
        // this.$refs.table.clearSelection()
        // this.selectedIndexs.length = 0
        // this.getData(e.current)
      },
    }
  }
</script>

<style lang="scss" scoped>
  .uni-group {
    display: flex;
    align-items: center;
  }
</style>